home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / CD32 / CD32_Support / examples / SA_Examples / lowlevel / VBlankInt / vblank.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-17  |  1.6 KB  |  92 lines

  1. /*
  2.  * System includes
  3.  */
  4.  
  5. #include <exec/types.h>
  6. #include <exec/memory.h>
  7.  
  8. #include <dos/dos.h>
  9.  
  10. #include <graphics/gfx.h>
  11. #include <graphics/gfxbase.h>
  12. #include <graphics/gfxmacros.h>
  13.  
  14. #include <intuition/intuition.h>
  15. #include <intuition/screens.h>
  16.  
  17. #include <clib/exec_protos.h>
  18. #include <clib/dos_protos.h>
  19. #include <clib/graphics_protos.h>
  20. #include <clib/intuition_protos.h>
  21. #include <clib/lowlevel_protos.h>
  22. #include <clib/alib_protos.h>
  23. /*#include <clib/debug_protos.h>*/
  24. extern void kprintf(const char *,...);
  25.  
  26. #include <pragmas/graphics_pragmas.h>
  27. #include <pragmas/lowlevel_pragmas.h>
  28.  
  29. /*
  30.  * ANSI includes
  31.  */
  32.  
  33. #include <stdio.h>
  34. #include <stdlib.h>
  35. #include <string.h>
  36. #include <math.h>
  37.  
  38. /*
  39.  * Local includes
  40.  */
  41.  
  42. #include "vblankint.h"
  43.  
  44. /****** vblankInt/vblankInterrupt ******************************************
  45. *
  46. *   NAME
  47. *       vblankInterrupt -- vertical blank interrupt handler
  48. *
  49. *   SYNOPSIS
  50. *       vblankInterrupt(intData);
  51. *
  52. *       void __asm __interrupt __saveds vblankInterrupt(register __a1 APTR intData);
  53. *
  54. *   FUNCTION
  55. *       Vertical blank interrupt handler.
  56. *
  57. *   INPUTS
  58. *       intData -- interrupt data
  59. *
  60. *   RESULT
  61. *       None
  62. *
  63. *   EXAMPLE
  64. *
  65. *   NOTES
  66. *
  67. *   BUGS
  68. *
  69. *   SEE ALSO
  70. *
  71. ******************************************************************************
  72. *
  73. */
  74.  
  75. void __asm __interrupt __saveds vblankInterrupt(register __a1 APTR intData)
  76. {
  77.  
  78.     /* Check vertical beam position */
  79.     if (VBeamPos()>vbeamThreshold) {
  80.         vblankIntThreshold++;
  81.     }
  82.  
  83.     /* Check interrupt data */
  84.     if (intData!=(APTR) VBLANKINT_COOKIE) {
  85.         vblankIntBadData++;
  86.     }
  87.  
  88.     /* Increment call count */
  89.     vblankIntCall++;
  90.  
  91. }
  92.